package com.bdsy.business.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bdsy.business.dao.FeedbackInfoMapper;
import com.bdsy.business.model.FeedbackInfo;
import com.bdsy.business.service.FeedbackInfoServcie;

@Service("feedbackInfoServcie")
public class FeedbackInfoServcieImpl implements FeedbackInfoServcie {

	@Autowired
	FeedbackInfoMapper feedbackInfoMapper;
	
	@Override
	public List<Map> feedbackInfoList() {
		@SuppressWarnings("rawtypes")
		List<Map> feedbackInfoList = feedbackInfoMapper.feedbackInfoList();
		return feedbackInfoList;
	}

	@Override
	public List<Map> feedbackInfoListById(String userId) {
		@SuppressWarnings("rawtypes")
		List<Map> feedbackInfoList =  feedbackInfoMapper.feedbackInfoListById(userId);
		return feedbackInfoList;
	}

	@Override
	public boolean insert(FeedbackInfo feedbackInfo) {
		int number = (int)((Math.random()*9+1)*10000000);
		feedbackInfo.setId(number);
		//默认为0 未受理
		feedbackInfo.setfStstus(0);
		int result = feedbackInfoMapper.insert(feedbackInfo);
		return result>0?true:false;
	}

}
